package cn.weiron.fun.sample.service.impl;


import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.util.ObjectUtil;
import cn.weiron.fun.sample.entity.SampleAudit;
import cn.weiron.fun.sample.mapper.SampleAuditMapper;
import cn.weiron.fun.sample.service.SampleAuditService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

/**
 * (SampleAudit)表服务实现类
 *
 * @author makejava
 * @since 2022-07-17 17:46:40
 */
@Service("sampleAuditServiceImpl")
public class SampleAuditServiceImpl extends ServiceImpl<SampleAuditMapper, SampleAudit> implements SampleAuditService {


    @Resource
    private SampleAuditMapper sampleAuditMapper;


    /**
     * 新增数据
     *
     * @param sampleAudit 实例对象
     * @return 实例对象
     */
    @Override
    public SampleAudit insert(SampleAudit sampleAudit) {
        this.sampleAuditMapper.insert(sampleAudit);
        return sampleAudit;
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer id) {
        return this.sampleAuditMapper.deleteById(id) > 0;
    }
}
